package com.tarena.demo.luban.all.main.service.impl;

import com.tarena.demo.luban.all.main.mapper.StockMapper;
import com.tarena.demo.luban.all.main.service.IStockService;
import com.tarena.demo.luban.protocol.stock.dos.StockDO;
import com.tarena.demo.luban.protocol.stock.param.StockReduceCountParam;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StockServiceImpl implements IStockService {

    @Autowired
    StockMapper stockMapper;

    @Override
    public void update(StockReduceCountParam stockReduceCountParam) {
        StockDO stockDO = new StockDO();
        stockDO.setProductCode(stockReduceCountParam.getProductCode());
        stockDO.setStock(stockReduceCountParam.getReduceCount());
        stockMapper.update(stockDO);
    }
}
